﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="CloudMLDemo.Controllers" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<% var controller = ViewContext.Controller as HomeController; %>

<head runat="server">
    <title>Job Submitted</title>
</head>
<body>

     <p>
        <% if (controller.IsSuccessful)
           {
               Response.Write("Your job have been submitted. Please do not refersh this window.");
           }
           else
           {
               Response.Write("Job submittion failed");
           }
       
        %>
    </p>
        <form method="POST" action="/Home/CheckJob" target="_blank">
            <input type="hidden" name="jobAddress" value="<% Response.Write(ViewContext.ViewData["jobAddress"]);%>">
             <input type="hidden" name="WSKey" value="<% Response.Write(controller.WebServiceKey);%>">
            <input type="submit" value="Check status">
        </form>
    <p>
        When finished, click the download button to download your job in .csv format
    </p>
    <p>
        <form method="POST" action="/Home/DownloadJob" target="_blank">
            <input type="hidden" name="jobAddress" value="<% Response.Write(ViewContext.ViewData["jobAddress"]);%>">
             <input type="hidden" name="WSKey" value="<% Response.Write(controller.WebServiceKey);%>">
            <input type="submit" value="Download output">
        </form>
    </p>
    <p>
        Or dump your job into a SQL table.
            <form method="POST" action="/Home/DumpJob" target="_blank">
                <input type="hidden" name="SqlConnectionString" value="<% Response.Write(this.ViewData["SqlConnectionString"]);%>">
                  <input type="hidden" name="WSEndpoint" value="<% Response.Write(controller.WebServiceEndPoint);%>">
                 <input type="hidden" name="WSKey" value="<% Response.Write(controller.WebServiceKey);%>">       
                <input type="hidden" name="jobAddress" value="<% Response.Write(ViewContext.ViewData["jobAddress"]);%>">
                Table name &nbsp;<input type="text" name="tableName" width="40"></input>
                <p>
                    <input type="submit" value="dump your job into a SQL table.">
                </p>
            </form>
    </p>

</body>
</html>
